/**
 * @Description: 异步聚焦 主要是为了解决ios 聚焦无法唤起键盘的问题
 * @Author bianpengfei
 * @create 2022/11/25 18:19
 */
export default {
  /**
   * @param {HTMLElement} el
   * @param {Object} binding
   */
  // eslint-disable-next-line no-unused-vars
  mounted(el, binding) {
    if (el.nodeType === Node.ELEMENT_NODE) {
      const inputDOM = el.querySelector('input')
      if (inputDOM) {
        inputDOM.readOnly = false
        inputDOM.addEventListener('mousedown', () => {
          inputDOM.readOnly = false
          inputDOM.focus()
        })
      }
    }
  }
}
